class Solution:
    def poorPigs(self, buckets: int, minutesToDie: int, minutesToTest: int) -> int:
        times = minutesToTest // minutesToDie
        for i in range(0, (buckets - 1).bit_length() + 1):
            if (times + 1) ** i >= buckets:
                return i


if __name__ == "__main__":
    print(Solution().poorPigs(buckets=1000, minutesToDie=15, minutesToTest=60))  # 5
    print(Solution().poorPigs(buckets=4, minutesToDie=15, minutesToTest=15))  # 2
    print(Solution().poorPigs(buckets=4, minutesToDie=15, minutesToTest=30))  # 2

    # 测试用例16
    print(Solution().poorPigs(buckets=1, minutesToDie=1, minutesToTest=1))  # 0
